package com.amuse.amuse.controller;

import com.amuse.amuse.entity.ResponseData;
import com.amuse.amuse.entity.students;
import com.amuse.amuse.service.impl.UserLoginServiceImpl;
import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RestController
@CrossOrigin
@RequestMapping("/user")
public class UserLoginController  extends BaseController{
    @Autowired
    private UserLoginServiceImpl userLoginService;
    @GetMapping("/login")
    public ResponseData studentLogin(Integer studentId, String password) {
        students students = userLoginService.studentLogin(studentId, password);
        return resultObj(students);
    }

    @PostMapping("/register")
    public ResponseData studentRegister(Integer studentId, String password, String name, String className, String grade, String courseType) {
        Integer integer = userLoginService.studentRegister(studentId, password, name, className, grade, courseType);
        return resultObj(integer);
    }
}
